<!DOCTYPE html>
<html>
	<head>
		<meta http-equiv="Content-Type" content="text/html; charset=UTF-8"/>
		<title>页面列表 -- Powered by CentIMS {$core_version}</title>
		<link href="{'bootstrap/css/bootstrap.css'|shared}" rel="stylesheet"/>
		<link href="{'bootstrap/css/bootstrap-responsive.css'|shared}" rel="stylesheet"/>
		<link href="{'plugins/ztree/ztree.css'|jquery}" rel="stylesheet"/>
		<link href="{'common.css'|shared}" rel="stylesheet"/>
		{'page_list_head'|fire}
	</head>
	<body>
		<div class="workspace">
			{include file='core/views/vfs/vfs_navi.tpl'}		    		
		   	<div class="tabbable tabs-left">
				<ul class="nav nav-tabs" style="min-height:350px;">					
					<li class="{if $status == 'draft'}active{/if}">
						<a href="."><i class="icon-file"></i>草稿箱({$draft_total})</a>
					</li>
					<li class="{if $status == 'approving'}active{/if}">
						<a href="./?status=approving" class="torg"><i class="icon-star-empty"></i>待审核({$approving_total})</a>
					</li>
					<li class="{if $status == 'unapproved'}active{/if}">
						<a href="./?status=unapproved" class="torg"><i class="icon-thumbs-down"></i>未批准({$unapproved_total})</a>
					</li>
					<li class="{if $status == 'approved'}active{/if}">
						<a href="./?status=approved" class="tgre"><i class="icon-thumbs-up"></i>已批准({$approved_total})</a>
					</li>
					<li class="{if $status == 'published'}active{/if}">
						<a href="./?status=published" class="tgre"><i class="icon-check"></i>已发布({$published_total})</a>
					</li>						
					<li class="{if $status == 'deleted'}active{/if}">
						<a href="./?status=deleted" class="tred"><i class="icon-trash"></i>回收站({$deleted_total})</a>
					</li>
				</ul>
				<div class="tab-content" style="padding-bottom:200px;">
					{if $page_tip_info}
					<div class="alert alert-error">
						<button class="close" data-dismiss="alert">×</button>
					   	{$page_tip_info}
				   	</div>
				    {/if}		
					<div>						
						<form class="well form-inline" method="get" action=".">
							<input type="hidden" name="status" value="{$status}"/>
							<div class="input-append">
			            		<input type="hidden" id="category" name="category" value="{$category}"/>
			              		<input type="text" class="input-medium" id="cname" name="cname" value="{$cname}" readonly="readonly"/><button id="btn-cate-select" class="btn" type="button">栏目..</button>
			              	</div>
							<input type="text" class="input-medium" name="title" value="{$title}" placeholder="标题"/>
							<select name="page_mode" class="input-small">
								{html_options options=$content_modes selected=$page_mode}
							</select>
							<select name="page_type" class="input-small">
								{html_options options=$page_types selected=$page_type}
							</select>
							<select name="tag" class="input-small">
								{html_options options=$tag_options selected=$tag}
							</select>
														
							<button type="submit" class="btn">搜索</button>
							<!--button type="button" class="btn">高级..</button-->
						</form>
					</div>
							    
					<table id="page-list" class="table table-striped table-bordered table-condensed">
						<thead>
							<tr>
								<th class="col_chk"><input type="checkbox"/></th>
								<th class="w50 txt-ac">{'PID'|sorth:page_id:$curl}</th>
								<th class="wa">{'网页'|sorth:create_time:$curl}</th>
								<th class="w80 txt-ac">{'模型'|sorth:page_mode:$curl}</th>
								<th class="w80 txt-ac">{'类型'|sorth:page_type:$curl}</th>							
								<th class="w180 txt-ac">{'栏目'|sorth:category:$curl}</th>
								<th class="w120 txt-ac">{'更新'|sorth:upate_time:$curl}</th>														
							</tr>
						</thead>
						<tbody>
							{foreach from=$items item=item}
							<tr>
								<td class="col_chk"><input type="checkbox" value="{$item.page_id}"/></td>
								<td class="txt-ac">{$item.page_id}</td>
								<td class="has-row-actions">
									<p>
										<span class="label mg-r5">由 {$item.user_name} 创建于										
										{$item.create_time|date_format:'%Y-%m-%d %H:%M'}
										</span>
										{if $item.publish_time}
											<span class="label label-success mg-r5">发布于
												{$item.update_time|date_format:'%Y-%m-%d %H:%M'}
											</span>
										{/if}
										{if $item.comments gt 0}
										<a href="../comment/?page_id={$item.page_id}"><span class="badge badge-info">{$item.comments}</span></a>
										{/if}																
									</p>
									<p>
										<a href="{$item|url}?preview" target="_blank" title="点击预览">{$item.title}</a>
										{'show_page_flags'|fire:$item}
									</p>
									<div class="row-actions">{'get_page_operation'|fire:$item}</div>
								</td>
								<td class="txt-ac">
									{$item.page_mode|status:$content_modes}
								</td>
								<td class="txt-ac">{$item.page_type|status:$page_types}</td>						
								<td>
									{if $item.category}
									<p>
										<span class="label mg-r5">栏目</span>
										<a href="./?status={$status}&category={$item.category}&cname={$item.category_name}">{$item.category_name}</a>
									</p>
									{/if}
									{if $item.subcategory}
									<p>
										<span class="label mg-r5">副栏目</span>
										<a href="./?status={$status}&category={$item.subcategory}&cname={$item.sub_category_name}">{$item.sub_category_name}</a>
									</p>
									{/if}
								</td>
								<td class="txt-ac">
									<strong>{$item.update_user_name}</strong><br/><br/>
									{$item.update_time|date_format:'%Y-%m-%d %H:%M'}
								</td>													
							</tr>
							{foreachelse}
							<tr>
								<td colspan="7" class="txt-ac">无记录</td>
							</tr>
							{/foreach}
						</tbody>
					</table>    
							    
					<div class="form-horizontal">
						<div class="control-group pull-left">
							<div class="btn-group">
								<button class="btn" id="btn-selectall"><i class="icon-check"></i>全选/反选</button>
								<a class="btn dropdown-toggle" data-toggle="dropdown" href="#"><span class="caret"></span></a>
								<ul id="page-dropdown-menu" class="dropdown-menu">
								{'get_page_bench_options'|fire:$status}
								</ul>
							</div>
						</div>
						<div class="pagination pull-right">
							{$curl|paging:$countTotal:$limit:'start'}
						</div>
					</div>				
					
				</div>
			</div>		    				    	
		</div>
		
		<div class="modal hide" id="cate-tree-modal">
		  	<div class="modal-header">
			    <button class="close" data-dismiss="modal">×</button>
			    <h3>选择频道栏目</h3>
		  	</div>
		  	
			<div class="modal-body" style="height:250px;overflow:auto;">
				<ul class="ztree" id="cate-tree"></ul>
			</div>
						  
			<div class="modal-footer">
				<span id="tpl-info" class="label label-warning" style="margin-right:15px;display:none;">请选择模板!</span>
				<a href="#" class="btn" id="btn-close-form">关闭</a>
				<a href="#" class="btn btn-primary" id="btn-done">确定</a>
			</div>
		</div>
		
		<script type="text/javascript" src="{'jquery-1.7.1.js'|jquery}"></script>
		<script type="text/javascript" src="{'bootstrap/bootstrap.js'|shared}"></script>
		<script type="text/javascript" src="{'plugins/ztree/ztree.js'|jquery}"></script>
		<script type="text/javascript" src="{'common.js'|shared}"></script>				
		<script type="text/javascript">
			var treeNodes = {$treeNodes};
		</script>
		<script type="text/javascript" src="page_list.js"></script>
		{'page_list_foot'|fire}
	</body>
</html>
